#include<bits/stdc++.h>
#define rg register
#define file(x)freopen(x".in","r",stdin);freopen(x".out","w",stdout)

using namespace std;

int main()
{
	while(1)
	{
		system("./gen > 1.in");
		system("./bbf < 1.in > 1.ans");
		system("./good < 1.in > 1.out");
		if(system("diff -w 1.out 1.ans"))
		{
			puts("WA");
			return 0;
		}
		puts("AC");
	}
	return 0;
}
